package org.holdren.jgabriel.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name="media")
public class Media implements Serializable
{
	private static final long serialVersionUID = 1L;
	
	public enum MediaType
	{
		video,
		audio,
		pdf,
		screencap
	}
	
	public enum Repository
	{
		cloudfront,
		church
	}
	
    @Id
    @GeneratedValue(strategy=GenerationType.AUTO)
    @Column(name="media_id")
    private Long id; 
    
    @ManyToOne
    @JoinColumn(name="service_id")
    private Service service;
    
    @Enumerated(EnumType.STRING)
    @Column(name="type")
    private MediaType mediaType;
    
    @Enumerated(EnumType.STRING)
    @Column(name="repository")
    private Repository repository;
    
    @Column(length=5)
    private String extension;

	public Long getId()
	{
		return id;
	}

	public void setId(Long id)
	{
		this.id = id;
	}

	public Service getService()
	{
		return service;
	}

	public void setService(Service service)
	{
		this.service = service;
	}

	public MediaType getMediaType()
	{
		return mediaType;
	}

	public void setMediaType(MediaType mediaType)
	{
		this.mediaType = mediaType;
	}

	public Repository getRepository()
	{
		return repository;
	}

	public void setRepository(Repository repository)
	{
		this.repository = repository;
	}

	public String getExtension()
	{
		return extension;
	}

	public void setExtension(String extension)
	{
		this.extension = extension;
	}
    
    
}
